<script setup lang="ts"></script>

<template>
</template>

<style>
/* 待办页面容器 */
.todo-page {
  display: flex;
  width: 100%;
  height: 100%;
  padding-top: 60px;
}

/* 侧边栏 */
.sidebar {
  width: 150px;
  border-right: 2px solid #333;
  padding: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

/* 侧边栏用户信息 */
.user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  border: 2px solid #333;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.username {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: #6366f1;
}

/* 退出按钮 */
.logout-btn {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border: 2px solid #333;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.logout-btn:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
}

/* 待办数量提示 */
.today-todo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  border: 2px solid #333;
  padding: 0.3rem;
  border-radius: 4px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.1);
}
.today-label { 
  font-size: 1rem;
  color: #e53935;
  font-weight: bold; 
}
.todo-count { 
  font-size: 1.2rem; 
  font-weight: bold; 
  color: #333; 
}

/* 分类列表 */
.category-list { 
  list-style: none; 
  display: flex; 
  flex-direction: column; 
  gap: 0.5rem; 
}
.category-item {
  font-size: 0.9rem; 
  color: #333; 
  cursor: pointer; 
  padding: 0.3rem 0.5rem;
  border: 2px solid transparent; 
  transition: all .2s; 
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.category-item::after {
  content: ''; 
  position: absolute; 
  bottom: 0; 
  left: 0.5rem; 
  width: 0; 
  height: 2px;
  background: #ff5722; 
  transition: width .3s;
}
.category-item:hover::after,
.category-item.active::after { 
  width: calc(100% - 1rem); 
}
.category-item.active { 
  background: rgba(255,87,34,.1); 
}

/* 主内容区 */
.main-content {
  flex: 1; 
  padding: 1.5rem; 
  display: flex; 
  flex-direction: column; 
  gap: 1.5rem;
  height: 100vh; 
  overflow-y: auto;
  min-width: 300px;
  background: inherit;
}

/* 任务输入组 */
.input-group {
  display: flex; 
  gap: 0.75rem; 
  width: 100%; 
  align-items: center;
}

/* 任务输入框 */
.task-input {
  flex: 1; 
  padding: 1rem; 
  border: 2px solid #333; 
  border-radius: 4px;
  font-size: 1rem; 
  background: #fff; 
  box-shadow: 3px 3px 0 rgba(0,0,0,.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.task-input:focus { 
  outline: none; 
  box-shadow: 4px 4px 0 rgba(99,102,241,.2); 
}

/* 分类选择框 */
.category-select {
  width: 100px;
  padding: 0.8rem 0.5rem; 
  border: 2px solid #333; 
  border-radius: 4px;
  font-size: 0.9rem; 
  background: #fff; 
  box-shadow: 3px 3px 0 rgba(0,0,0,.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}
.category-select:focus {
  outline: none;
  box-shadow: 4px 4px 0 rgba(99,102,241,.2);
}

/* 添加任务按钮 */
.add-btn {
  width: 3rem; 
  height: 3rem; 
  border: 2px solid #333; 
  border-radius: 4px;
  background: #fff; 
  color: #333; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  cursor: pointer; 
  transition: all .3s; 
  box-shadow: 3px 3px 0 rgba(0,0,0,.1);
  font-size: 1.2rem; 
  font-weight: bold;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.add-btn:hover { 
  background: #f5f5f5; 
  transform: translateY(-2px); 
  box-shadow: 4px 4px 0 rgba(0,0,0,.15); 
}

/* 全选按钮 */
.select-all-btn {
  width: 3rem;
  height: 3rem;
  border: 2px solid #333;
  border-radius: 4px;
  background: #fff;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 3px 3px 0 rgba(0,0,0,.1);
  font-size: 0.8rem;
  font-weight: bold;
  user-select: none;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.select-all-btn:hover {
  background: #f5f5f5;
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 rgba(0,0,0,.15);
}
.select-all-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.select-all-checkbox:checked + .select-all-text {
  color: #6366f1;
  font-weight: bold;
}

/* 任务容器 */
.tasks-wrapper { 
  display: flex; 
  flex-direction: column; 
  gap: 1.5rem; 
}

/* 任务组（未完成/已完成） */
.task-group { 
  display: flex; 
  flex-direction: column; 
  gap: 1rem; 
}

/* 任务组标题 */
.group-title {
  font-size: 1.4rem; 
  font-weight: bold; 
  color: #333; 
  position: relative; 
  display: inline-block;
}
.group-title::after {
  content: ''; 
  position: absolute; 
  bottom: -4px; 
  left: 0; 
  width: 100%; 
  height: 3px; 
  background: #ff5722;
}
.completed .group-title::after { 
  background: #4caf50; 
}

/* 任务列表 */
.task-list { 
  list-style: none; 
  display: flex; 
  flex-direction: column; 
  gap: 1rem; 
}

/* 单个任务项 */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem; 
  background: #fff;
  border: 2px solid #333; 
  border-radius: 4px; 
  box-shadow: 3px 3px 0 rgba(0,0,0,.1); 
  transition: all .3s;
}
.task-item:hover { 
  box-shadow: 4px 4px 0 rgba(0,0,0,.15); 
  transform: translateY(-2px); 
}

/* 任务信息区 */
.task-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

/* 任务操作按钮组 */
.task-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* 完成/删除按钮 */
.complete-btn,
.delete-btn { 
  background: transparent; 
  border: none; 
  cursor: pointer; 
  transition: all .2s;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.complete-btn svg,
.delete-btn svg {
  width: 100%;
  height: 100%;
}
.complete-btn { 
  color: #757575; 
}
.complete-btn:hover { 
  color: #ff5722; 
  transform: scale(1.1); 
}
.delete-btn { 
  color: #757575; 
}
.delete-btn:hover { 
  color: #f44336; 
  transform: scale(1.1); 
}

/* 任务文本 */
.task-text { 
  flex: 1; 
  font-size: 1rem; 
  line-height: 1.6; 
  word-break: break-word; 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
  cursor: text;
  transition: color 0.2s;
}
.task-text:hover {
  color: #6366f1;
}
.completed-text { 
  text-decoration: line-through; 
  color: #757575; 
  opacity: .8; 
}

/* 任务分类标签 */
.task-category {
  font-size: .8rem; 
  color: #fff; 
  background: #6366f1; 
  padding: .2rem .5rem; 
  border-radius: 4px; 
  white-space: nowrap;
}

/* 空状态提示 */
.empty-state {
  margin: 15px 0 0 0;
  text-align: center;
  font-size: 18px;
  color: #aaa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 任务复选框 */
.task-checkbox {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  accent-color: #6366f1;
  cursor: pointer;
}

/* 批量操作栏 */
.batch-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fffdf0;
  color: #333;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  box-shadow: 0 -2px 6px rgba(0,0,0,.1);
  border-top: 2px solid #333;
  z-index: 10;
}
.batch-bar button {
  background: #fff;
  color: #333;
  border: 2px solid #333;
  border-radius: 4px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 rgba(0,0,0,.1);
}
.batch-bar button:hover {
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 rgba(0,0,0,.15);
}

/* 任务编辑区域 */
.edit-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}
.edit-input {
  flex: 1;
  padding: 0.5rem;
  border: 2px solid #6366f1;
  border-radius: 4px;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 2px 2px 0 rgba(99,102,241,.1);
}
.edit-input:focus {
  outline: none;
  box-shadow: 3px 3px 0 rgba(99,102,241,.2);
}
.edit-save-btn, .edit-cancel-btn {
  padding: 0.3rem 0.6rem;
  border: 2px solid #333;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 2px 2px 0 rgba(0,0,0,.1);
}
.edit-save-btn {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}
.edit-cancel-btn {
  background: #fff;
  color: #333;
}
.edit-save-btn:hover, .edit-cancel-btn:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 rgba(0,0,0,.15);
}
/* 编辑按钮样式 */
.edit-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .2s;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #757575;
}
.edit-btn svg {
  width: 100%;
  height: 100%;
}
.edit-btn:hover {
  color: #6366f1;
  transform: scale(1.1);
}
</style>